import request from '@/utils/request'

//获取拓扑图信息
export function getPowerinfor(data){
    return request({
        url:'/deviceInfo/dcPowerSupply',
        method:'get',
        data
    })
}

//告警  分页
export function getalarmData(data){
    return request({
        url:'/alarm/page',
        method:'post',
        data
    })
}

//告警 详情
export function getalarmInfor(data){
    const id = data;
    return request({
        url: `/alarm/infoById?id=${id}`,
        method: 'get'
    });
}

//告警 删除
export function getalarmDelete(ids){
    const params = new URLSearchParams();
    params.append('ids', ids);
    return request({
        url: `/alarm/deleteById?${params.toString()}`,
        method:'delete',
    })
}

//告警 统计
export function getStatistics(data){
    return request({
        url:'/alarm/statistics',
        method:'get',
        data
    })
}

//电子元器件  分页
export function getelecData(data){
    return request({
        url:'/electricComponent/page',
        method:'post',
        data
    })
}
//电子元器件 删除
export function getelecDelete(ids){
    const params = new URLSearchParams();
    params.append('ids', ids);
    return request({
        url: `/electricComponent/deleteById?${params.toString()}`,
        method:'delete',
    })
}

//电子元器件 上传
export function getelecUpload(data){
    return request({
        url:'/electricComponent/save',
        method:'post',
        data
    })
}

//采集分页
export function getcollectData(data){
    return request({
        url:'/deviceInfo/page',
        method:'post',
        data
    })
}

//采集详情
export function getcollectInfor(data){
    const deviceInfoId = data;
    return request({
        url: `/deviceInfo/branchInfoByDeviceId?deviceInfoId=${deviceInfoId}`,
        method: 'get'
    });
}